{#% extends "registration/reg_base.html" %#}
{% extends 'common/panel.html' %}
{% load order_by %}

{% block title %}User Profile{% endblock title %}

{% block panel %}
<style>
.group {padding:0;margin:0;text-indent:none;font-size:12px;}
.groups {padding:0;margin:0;text-indent:none;}
</style>

<h2> Personal Info </h2>
<div class="box">
    <form action="{% url user_profile-form profile.user.username%}" method="post">
        <p><label>Username:</label> <input type="text" readonly value="{{ profile.user.username }}" /> </p>
        {{ uform.as_p }}
        {{ pform.as_p }}
        <p><label>Password:</label> <a class="panel_link" href="{% url auth_password_change %}">Change password</a></p>
        <input type="submit" value="Submit Changes" />
    </form>

    {% if use_openid %}
    <hr/>
    <h2> Identification Providers </h2>
    <p>[<a href="{% url user_associate %}">Associate with an OpenID</a>]</p>
    {% if assoc %}
    <div>
        <p> Your are currently associated with the following OpenID providers.  </p>
        <ul class="groups">
        {% for openid in assoc %}
        <li class="group"> <span> {{openid.openid_url}}</span><span>[<a href="{% url user_dissociate %}?openid_url={{openid.openid_url}}">Remove</a>]</span> </li>
        {% endfor %}        
        </ul>
    </div>
    {% endif %}
    {% endif %}
</div>

<div class="box">
    <h2 style="margin-top:5px;"> Groups </h2>
    <div>
    {% if profile.user.groups %}
        <p> Your are currently a member of the following groups.  </p>
        <ul class="groups">
        {% for group in profile.user.groups.all %}
            <li class="group"> <span><p style="margin-left:20px"> {{group.name}}</p></span> </li>
        {% endfor %}        
        </ul>
        {% if group_request_email %}
        <p> To request membership with another group or groups, please send an email to 
        <a href="mailto:{{group_request_email}}">{{group_request_email}}</a> with your username and group requests.</p>
        {% endif %}
    {% endif %}
    </div>
</div>

<style type="text/css">
textarea {
    width: 400px !important;
    height: 80px;
}
</style>

{% endblock panel %}
